<!DOCTYPE html>
<html>
  <head>
    <meta charset='utf-8'>
    <meta http-equiv="X-UA-Compatible" content="chrome=1">
    
      <title>gist: 193286 -  GitHub</title>
    

    <link href="https://assets2.github.com/stylesheets/bundle_common.css?8ba4a5b555baa7617baab8277634c5c7550a44d7" media="screen" rel="stylesheet" type="text/css" />
<link href="https://assets1.github.com/stylesheets/bundle_gist.css?8ba4a5b555baa7617baab8277634c5c7550a44d7" media="screen" rel="stylesheet" type="text/css" />

    <script type="text/javascript" charset="utf-8">
      var GitHub = {}
    </script>
    <script src="https://assets0.github.com/javascripts/jquery/jquery-1.4.2.min.js?8ba4a5b555baa7617baab8277634c5c7550a44d7" type="text/javascript"></script>
    <script src="https://assets0.github.com/javascripts/bundle_common.js?8ba4a5b555baa7617baab8277634c5c7550a44d7" type="text/javascript"></script>
<script src="https://assets2.github.com/javascripts/bundle_gist.js?8ba4a5b555baa7617baab8277634c5c7550a44d7" type="text/javascript"></script>

            
    
  <link href="https://github.com/api/oembed?format=json&amp;url=https%3A%2F%2Fgist.github.com%2F193286" rel="alternate" title="gist: 193286" type="application/json+oembed" />
  

        <script type="text/javascript">
      var _gaq = _gaq || [];
      _gaq.push(['_setAccount', 'UA-3769691-4']);
      _gaq.push(['_trackPageview']);
      (function() {
        var ga = document.createElement('script');
        ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
        ga.setAttribute('async', 'true');
        document.documentElement.firstChild.appendChild(ga);
      })();
    </script>

  </head>

  <body>
    <div id="main">
      <div id="header" class="">
        <div class="site">
          <div class="logo">
            <a href="/"><img src="/images/modules/header/logo_gist.png" alt="gist" /></a>
          </div>

          
            <ul class="userbox logged_out">
              <ul class="usernav">
                <li><a href="/login?return_to=gist">Login</a></li>
                <li><a href="https://github.com/signup?return_to=gist">Signup for a GitHub Account</a></li>
              </ul>
            </ul>
          

          <div class="topsearch">
            <form action="/gists/search" id="top_search_form" method="get">
              <input type="search" name="q" value="" results="5" class="search" placeholder="Search Gists&hellip;" /> <input type="submit" value="Search" class="button" />
              <input type="hidden" name="page" value="1" />
            </form>

            <ul class="nav">
              <li><a href="/">New Gist</a></li>
              
              <li><a href="/gists">All Gists</a></li>
              <li><a href="https://github.com">Back to GitHub</a></li>
            </ul>
          </div><!-- /.topsearch -->
        </div>
      </div>

    <div class="site">
      
<div class="secondary">

  <div id="owner">
    
      <div class="actor">
        <div class="gravatar">
          <img src="https://secure.gravatar.com/avatar/040e5cf6a6367b485e5a86e519011b28?s=140&d=https://github.com%2Fimages%2Fgravatars%2Fgravatar-140.png" alt="" width="30" height="30"  />
        </div>
        <div class="name"><a href="/mooz">mooz</a> <span>(owner)</span></div>
      </div>
    
  </div>

  

  
  

  
  
  <div id="revisions">
    <h3>Revisions</h3>
    <ul>
      
      
        
        <li class="current">
          <img src="/images/modules/gist/dot_green.png" alt=""/><img src="/images/modules/gist/dot_green.png" alt=""/><img src="/images/modules/gist/dot_green.png" alt=""/><img src="/images/modules/gist/dot_red.png" alt=""/><img src="/images/modules/gist/dot_red.png" alt=""/><img src="/images/modules/gist/dot_red.png" alt=""/><img src="/images/modules/gist/dot_gray.png" alt=""/>
          <a href="https://gist.github.com/193286/ab7f139a076e5ea70ed786cfbf77e1014dcf6c55" class="id">ab7f13</a>

          
            <a href="/mooz" class="author">mooz</a>
          
          <span class="date"><abbr class="relatize" title="2009-09-25 01:20:38">Fri Sep 25 01:20:38 -0700 2009</abbr></span>
        </li>
      
        
        <li class="other">
          <img src="/images/modules/gist/dot_green.png" alt=""/><img src="/images/modules/gist/dot_green.png" alt=""/><img src="/images/modules/gist/dot_green.png" alt=""/><img src="/images/modules/gist/dot_green.png" alt=""/><img src="/images/modules/gist/dot_red.png" alt=""/><img src="/images/modules/gist/dot_gray.png" alt=""/><img src="/images/modules/gist/dot_gray.png" alt=""/>
          <a href="https://gist.github.com/193286/73c37137f556a3587a1e664125fad2d8745ec280" class="id">73c371</a>

          
            <a href="/mooz" class="author">mooz</a>
          
          <span class="date"><abbr class="relatize" title="2009-09-24 21:30:43">Thu Sep 24 21:30:43 -0700 2009</abbr></span>
        </li>
      
        
        <li class="other">
          <img src="/images/modules/gist/dot_green.png" alt=""/><img src="/images/modules/gist/dot_green.png" alt=""/><img src="/images/modules/gist/dot_green.png" alt=""/><img src="/images/modules/gist/dot_green.png" alt=""/><img src="/images/modules/gist/dot_red.png" alt=""/><img src="/images/modules/gist/dot_red.png" alt=""/><img src="/images/modules/gist/dot_gray.png" alt=""/>
          <a href="https://gist.github.com/193286/01f109330f46368f87ae12af37d43ca5e0da68ee" class="id">01f109</a>

          
            <a href="/mooz" class="author">mooz</a>
          
          <span class="date"><abbr class="relatize" title="2009-09-24 21:06:38">Thu Sep 24 21:06:38 -0700 2009</abbr></span>
        </li>
      
        
        <li class="other">
          <img src="/images/modules/gist/dot_green.png" alt=""/><img src="/images/modules/gist/dot_green.png" alt=""/><img src="/images/modules/gist/dot_green.png" alt=""/><img src="/images/modules/gist/dot_green.png" alt=""/><img src="/images/modules/gist/dot_green.png" alt=""/><img src="/images/modules/gist/dot_green.png" alt=""/><img src="/images/modules/gist/dot_gray.png" alt=""/>
          <a href="https://gist.github.com/193286/7158b09075fdc32833b630b42ec8a4f241bca9bf" class="id">7158b0</a>

          
            <a href="/mooz" class="author">mooz</a>
          
          <span class="date"><abbr class="relatize" title="2009-09-24 20:51:50">Thu Sep 24 20:51:50 -0700 2009</abbr></span>
        </li>
      
    </ul>
  </div>
  
</div><!-- /.secondary -->

<div class="main">
  <div id="repos">
    <div class="repo public">
      <div class="title">
        <div class="path">
          gist: 193286

          

          
            <a href="/gists/193286/download"><img alt="Download_button" border="0" class="button" src="https://assets3.github.com/images/modules/repos/download_button.png?8ba4a5b555baa7617baab8277634c5c7550a44d7" /></a>
          

          
            
            <a href="http://github.com/signup"><img alt="fork" class="button" src="https://assets1.github.com/images/modules/repos/fork_button.png?8ba4a5b555baa7617baab8277634c5c7550a44d7" /></a>
          
          
        </div>

        
          <div class="security public_security" style="">
            <a href="#public_repo" rel="facebox"><img src="/images/icons/public.png" alt="public" /></a>
          </div>
        

        <div id="private_repo" class="hidden">
          <h2>Private Gist</h2>
          <p>
            All pages are served over SSL and all pushing and pulling is done over SSH.
            No one may fork, clone, or view it unless they are given this private URL.
          </p>
          <p>Every gist with this icon (<img src="/images/icons/private.png" alt="private" />) is private.</p>
        </div>
        <div class="security public_security" style="display:none">
          <a href="#public_repo" rel="facebox"><img src="/images/icons/public.png" alt="public" /></a>
        </div>
        <div id="public_repo" class="hidden">
          <h2>Public Gist</h2>
          <p>Anyone may fork, clone, or view it.</p>
          <p>Every repository with this icon (<img src="/images/icons/public.png" alt="public" />) is public.</p>
        </div>
      </div>

      <div class="meta">
        <table>
          

          
            <tr>
              <td class="label">Public Clone URL:</td>
              <td>
                <a rel="#git-clone" class="git_url_facebox" href="git://gist.github.com/193286.git">git://gist.github.com/193286.git</a>
                <div id="git-clone" style="display:none; min-width:500px">
                  Give this clone URL to anyone.
                  <br/>

                  <code>git clone git://gist.github.com/193286.git gist-193286</code>
                </div>
              </td>
            </tr>
          

          

          
            <tr>
              <td class="label">Embed All Files:</td>
              <td>
                <a href="#" class="gist-embed-link">show embed</a>
                <input class="gist-embed-box" type="text" size="25" value='<script src="https://gist.github.com/193286.js"> </script>' style="display:none;"/>
              </td>
            </tr>
          

        </table>
      </div>
    </div>
  </div>

  <div id="files">

    
    
      

      <div class="file" id="file_gistfile1.js">
  <div class="meta clearfix">
    <div class="info">
      <span class="code">JavaScript <a href="#file_gistfile1.js">#</a></span>
    </div>
    <div class="actions">
      
      <div id="gist-embed" style="display:inline;">
        <a href="#" class="gist-embed-link">embed</a>
        <input class="gist-embed-box" type="text" size="25" value='<script src="https://gist.github.com/193286.js?file=gistfile1.js"></script>' style="display:none;"/>
      </div>
      
      
      <a href="/raw/193286/5aaf521c1f2627a54e4f622e67aedd1538ec5907/gistfile1.js">raw</a>
    </div>
  </div>
  
  
  <div class="data type-javascript">
    
      <table cellpadding="0" cellspacing="0">
        <tr>
          <td>
            <pre class="line_numbers"><span id="L1" rel="#L1">1</span>
<span id="L2" rel="#L2">2</span>
<span id="L3" rel="#L3">3</span>
<span id="L4" rel="#L4">4</span>
<span id="L5" rel="#L5">5</span>
<span id="L6" rel="#L6">6</span>
<span id="L7" rel="#L7">7</span>
<span id="L8" rel="#L8">8</span>
<span id="L9" rel="#L9">9</span>
<span id="L10" rel="#L10">10</span>
<span id="L11" rel="#L11">11</span>
<span id="L12" rel="#L12">12</span>
<span id="L13" rel="#L13">13</span>
<span id="L14" rel="#L14">14</span>
<span id="L15" rel="#L15">15</span>
<span id="L16" rel="#L16">16</span>
<span id="L17" rel="#L17">17</span>
<span id="L18" rel="#L18">18</span>
<span id="L19" rel="#L19">19</span>
<span id="L20" rel="#L20">20</span>
<span id="L21" rel="#L21">21</span>
<span id="L22" rel="#L22">22</span>
<span id="L23" rel="#L23">23</span>
<span id="L24" rel="#L24">24</span>
<span id="L25" rel="#L25">25</span>
<span id="L26" rel="#L26">26</span>
<span id="L27" rel="#L27">27</span>
<span id="L28" rel="#L28">28</span>
<span id="L29" rel="#L29">29</span>
<span id="L30" rel="#L30">30</span>
<span id="L31" rel="#L31">31</span>
<span id="L32" rel="#L32">32</span>
<span id="L33" rel="#L33">33</span>
<span id="L34" rel="#L34">34</span>
<span id="L35" rel="#L35">35</span>
<span id="L36" rel="#L36">36</span>
<span id="L37" rel="#L37">37</span>
<span id="L38" rel="#L38">38</span>
<span id="L39" rel="#L39">39</span>
<span id="L40" rel="#L40">40</span>
<span id="L41" rel="#L41">41</span>
<span id="L42" rel="#L42">42</span>
<span id="L43" rel="#L43">43</span>
<span id="L44" rel="#L44">44</span>
<span id="L45" rel="#L45">45</span>
<span id="L46" rel="#L46">46</span>
<span id="L47" rel="#L47">47</span>
<span id="L48" rel="#L48">48</span>
<span id="L49" rel="#L49">49</span>
<span id="L50" rel="#L50">50</span>
<span id="L51" rel="#L51">51</span>
<span id="L52" rel="#L52">52</span>
<span id="L53" rel="#L53">53</span>
<span id="L54" rel="#L54">54</span>
<span id="L55" rel="#L55">55</span>
<span id="L56" rel="#L56">56</span>
<span id="L57" rel="#L57">57</span>
<span id="L58" rel="#L58">58</span>
<span id="L59" rel="#L59">59</span>
<span id="L60" rel="#L60">60</span>
<span id="L61" rel="#L61">61</span>
</pre>
          </td>
          <td width="100%">
            
              
                <div class="highlight"><pre><div class='line' id='LC1'><span class="nx">key</span><span class="p">.</span><span class="nx">setGlobalKey</span><span class="p">([</span><span class="s1">&#39;C-x&#39;</span><span class="p">,</span> <span class="s1">&#39;0&#39;</span><span class="p">],</span> <span class="kd">function</span> <span class="p">(</span><span class="nx">ev</span><span class="p">,</span> <span class="nx">arg</span><span class="p">)</span> <span class="p">{</span></div><div class='line' id='LC2'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="nx">SplitBrowser</span><span class="p">.</span><span class="nx">activeBrowserCloseWindow</span><span class="p">();</span></div><div class='line' id='LC3'><span class="p">},</span> <span class="s1">&#39;現在のフレームを閉じる&#39;</span><span class="p">);</span></div><div class='line' id='LC4'><br/></div><div class='line' id='LC5'><span class="nx">key</span><span class="p">.</span><span class="nx">setGlobalKey</span><span class="p">([</span><span class="s1">&#39;C-x&#39;</span><span class="p">,</span> <span class="s1">&#39;1&#39;</span><span class="p">],</span> <span class="kd">function</span> <span class="p">(</span><span class="nx">ev</span><span class="p">,</span> <span class="nx">arg</span><span class="p">)</span> <span class="p">{</span></div><div class='line' id='LC6'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="kd">var</span> <span class="nx">url</span> <span class="o">=</span> <span class="nx">SplitBrowser</span><span class="p">.</span><span class="nx">activeBrowser</span> <span class="o">!=</span> <span class="nx">gBrowser</span> <span class="o">?</span> <span class="nx">SplitBrowser</span><span class="p">.</span><span class="nx">activeSubBrowser</span><span class="p">.</span><span class="nx">src</span> <span class="o">:</span> <span class="kc">null</span><span class="p">;</span></div><div class='line' id='LC7'><br/></div><div class='line' id='LC8'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="kd">var</span> <span class="nx">browsers</span> <span class="o">=</span> <span class="nx">SplitBrowser</span><span class="p">.</span><span class="nx">browsers</span><span class="p">;</span></div><div class='line' id='LC9'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">for</span> <span class="p">(</span><span class="kd">var</span> <span class="nx">i</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span> <span class="nx">i</span> <span class="o">&lt;</span> <span class="nx">browsers</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span> <span class="o">++</span><span class="nx">i</span><span class="p">)</span></div><div class='line' id='LC10'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="nx">browsers</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">close</span><span class="p">();</span></div><div class='line' id='LC11'><br/></div><div class='line' id='LC12'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">if</span> <span class="p">(</span><span class="nx">url</span><span class="p">)</span> <span class="nb">window</span><span class="p">.</span><span class="nx">loadURI</span><span class="p">(</span><span class="nx">url</span><span class="p">);</span></div><div class='line' id='LC13'><span class="p">},</span> <span class="s1">&#39;現在のフレームだけを表示&#39;</span><span class="p">);</span></div><div class='line' id='LC14'><br/></div><div class='line' id='LC15'><span class="nx">key</span><span class="p">.</span><span class="nx">setGlobalKey</span><span class="p">([</span><span class="s1">&#39;C-x&#39;</span><span class="p">,</span> <span class="s1">&#39;2&#39;</span><span class="p">],</span> <span class="kd">function</span> <span class="p">(</span><span class="nx">ev</span><span class="p">,</span> <span class="nx">arg</span><span class="p">)</span> <span class="p">{</span></div><div class='line' id='LC16'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="nx">SplitBrowser</span><span class="p">.</span><span class="nx">addSubBrowser</span><span class="p">(</span><span class="nb">window</span><span class="p">.</span><span class="nx">content</span><span class="p">.</span><span class="nx">location</span><span class="p">.</span><span class="nx">href</span><span class="p">,</span></div><div class='line' id='LC17'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="nx">SplitBrowser</span><span class="p">.</span><span class="nx">activeSubBrowser</span><span class="p">,</span></div><div class='line' id='LC18'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="nx">SplitBrowser</span><span class="p">.</span><span class="nx">POSITION_BOTTOM</span><span class="p">);</span></div><div class='line' id='LC19'><span class="p">},</span> <span class="s1">&#39;フレームを横に分割&#39;</span><span class="p">);</span></div><div class='line' id='LC20'><br/></div><div class='line' id='LC21'><span class="nx">key</span><span class="p">.</span><span class="nx">setGlobalKey</span><span class="p">([</span><span class="s1">&#39;C-x&#39;</span><span class="p">,</span> <span class="s1">&#39;3&#39;</span><span class="p">],</span> <span class="kd">function</span> <span class="p">(</span><span class="nx">ev</span><span class="p">,</span> <span class="nx">arg</span><span class="p">)</span> <span class="p">{</span></div><div class='line' id='LC22'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="nx">SplitBrowser</span><span class="p">.</span><span class="nx">addSubBrowser</span><span class="p">(</span><span class="nb">window</span><span class="p">.</span><span class="nx">content</span><span class="p">.</span><span class="nx">location</span><span class="p">.</span><span class="nx">href</span><span class="p">,</span></div><div class='line' id='LC23'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="nx">SplitBrowser</span><span class="p">.</span><span class="nx">activeSubBrowser</span><span class="p">,</span></div><div class='line' id='LC24'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="nx">SplitBrowser</span><span class="p">.</span><span class="nx">POSITION_RIGHT</span><span class="p">);</span></div><div class='line' id='LC25'><span class="p">},</span> <span class="s1">&#39;フレームを縦に分割&#39;</span><span class="p">);</span></div><div class='line' id='LC26'><br/></div><div class='line' id='LC27'><span class="nx">key</span><span class="p">.</span><span class="nx">setGlobalKey</span><span class="p">([</span><span class="s1">&#39;C-x&#39;</span><span class="p">,</span> <span class="s1">&#39;k&#39;</span><span class="p">],</span> <span class="kd">function</span> <span class="p">(</span><span class="nx">ev</span><span class="p">,</span> <span class="nx">arg</span><span class="p">)</span> <span class="p">{</span></div><div class='line' id='LC28'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="kd">var</span> <span class="nx">b</span> <span class="o">=</span> <span class="nx">SplitBrowser</span><span class="p">.</span><span class="nx">activeBrowser</span><span class="p">;</span></div><div class='line' id='LC29'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">if</span> <span class="p">(</span><span class="nx">b</span><span class="p">.</span><span class="nx">mTabs</span><span class="p">.</span><span class="nx">length</span> <span class="o">&gt;</span> <span class="mi">1</span><span class="p">)</span> <span class="p">{</span></div><div class='line' id='LC30'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="nx">b</span><span class="p">.</span><span class="nx">removeTab</span><span class="p">(</span><span class="nx">b</span><span class="p">.</span><span class="nx">mCurrentTab</span><span class="p">);</span></div><div class='line' id='LC31'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">}</span> <span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="nx">b</span> <span class="o">===</span> <span class="nx">gBrowser</span><span class="p">)</span> <span class="p">{</span></div><div class='line' id='LC32'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="nx">gBrowser</span><span class="p">.</span><span class="nx">removeTab</span><span class="p">(</span><span class="nx">gBrowser</span><span class="p">.</span><span class="nx">mCurrentTab</span><span class="p">);</span></div><div class='line' id='LC33'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">}</span></div><div class='line' id='LC34'><span class="p">},</span> <span class="s1">&#39;現在のタブを閉じる&#39;</span><span class="p">);</span></div><div class='line' id='LC35'><br/></div><div class='line' id='LC36'><span class="nx">key</span><span class="p">.</span><span class="nx">setGlobalKey</span><span class="p">([</span><span class="s1">&#39;C-x&#39;</span><span class="p">,</span> <span class="s1">&#39;o&#39;</span><span class="p">],</span> <span class="kd">function</span> <span class="p">(</span><span class="nx">ev</span><span class="p">,</span> <span class="nx">arg</span><span class="p">)</span> <span class="p">{</span></div><div class='line' id='LC37'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="kd">function</span> <span class="nx">focusSubBrowserById</span><span class="p">(</span><span class="nx">aId</span><span class="p">)</span> <span class="p">{</span></div><div class='line' id='LC38'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="nx">SplitBrowser</span><span class="p">.</span><span class="nx">getSubBrowserById</span><span class="p">(</span><span class="nx">aId</span><span class="p">).</span><span class="nx">browser</span><span class="p">.</span><span class="nx">contentWindow</span><span class="p">.</span><span class="nx">focus</span><span class="p">();</span></div><div class='line' id='LC39'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">}</span></div><div class='line' id='LC40'><br/></div><div class='line' id='LC41'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="kd">var</span> <span class="nx">browsers</span> <span class="o">=</span> <span class="nx">SplitBrowser</span><span class="p">.</span><span class="nx">browsers</span><span class="p">;</span></div><div class='line' id='LC42'><br/></div><div class='line' id='LC43'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">if</span> <span class="p">(</span><span class="nx">SplitBrowser</span><span class="p">.</span><span class="nx">activeBrowser</span> <span class="o">===</span> <span class="nx">gBrowser</span><span class="p">)</span> <span class="p">{</span></div><div class='line' id='LC44'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="nx">focusSubBrowserById</span><span class="p">(</span><span class="nx">browsers</span><span class="p">[(</span><span class="nx">arg</span> <span class="o">==</span> <span class="kc">null</span><span class="p">)</span> <span class="o">?</span> <span class="mi">0</span> <span class="o">:</span> <span class="nx">browsers</span><span class="p">.</span><span class="nx">length</span> <span class="o">-</span> <span class="mi">1</span><span class="p">].</span><span class="nx">id</span><span class="p">);</span></div><div class='line' id='LC45'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">return</span><span class="p">;</span></div><div class='line' id='LC46'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">}</span></div><div class='line' id='LC47'><br/></div><div class='line' id='LC48'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="kd">var</span> <span class="nx">id</span> <span class="o">=</span> <span class="nx">SplitBrowser</span><span class="p">.</span><span class="nx">activeSubBrowser</span><span class="p">.</span><span class="nx">id</span><span class="p">;</span></div><div class='line' id='LC49'><br/></div><div class='line' id='LC50'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">for</span> <span class="p">(</span><span class="kd">var</span> <span class="nx">i</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span> <span class="nx">i</span> <span class="o">&lt;</span> <span class="nx">browsers</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span> <span class="nx">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span></div><div class='line' id='LC51'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">if</span> <span class="p">(</span><span class="nx">browsers</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">id</span> <span class="o">==</span> <span class="nx">id</span><span class="p">)</span></div><div class='line' id='LC52'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">break</span><span class="p">;</span></div><div class='line' id='LC53'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">}</span></div><div class='line' id='LC54'><br/></div><div class='line' id='LC55'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="kd">var</span> <span class="nx">nextIndex</span> <span class="o">=</span> <span class="p">(</span><span class="nx">arg</span> <span class="o">==</span> <span class="kc">null</span><span class="p">)</span> <span class="o">?</span> <span class="nx">i</span> <span class="o">+</span> <span class="mi">1</span> <span class="o">:</span> <span class="nx">i</span> <span class="o">-</span> <span class="mi">1</span><span class="p">;</span></div><div class='line' id='LC56'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">if</span> <span class="p">(</span><span class="nx">nextIndex</span> <span class="o">&gt;=</span> <span class="nx">browsers</span><span class="p">.</span><span class="nx">length</span> <span class="o">||</span> <span class="nx">nextIndex</span> <span class="o">&lt;</span> <span class="mi">0</span><span class="p">)</span></div><div class='line' id='LC57'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="nx">gBrowser</span><span class="p">.</span><span class="nx">contentWindow</span><span class="p">.</span><span class="nx">focus</span><span class="p">();</span></div><div class='line' id='LC58'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">else</span></div><div class='line' id='LC59'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="nx">focusSubBrowserById</span><span class="p">(</span><span class="nx">browsers</span><span class="p">[</span><span class="nx">nextIndex</span><span class="p">].</span><span class="nx">id</span><span class="p">);</span></div><div class='line' id='LC60'><span class="p">}</span></div><div class='line' id='LC61'><span class="p">,</span> <span class="s1">&#39;次のフレームを選択&#39;</span><span class="p">,</span> <span class="kc">true</span><span class="p">);</span></div></pre></div>
              
            
          </td>
        </tr>
      </table>
    
  </div>


  
</div>


      

     <!-- cache end -->

    

  </div>

  
    <div id="comments">
      

      
        Please <a href="/login?return_to=https://gist.github.com/193286">log in</a> to comment.
      
    </div>
  

</div><!-- /.main -->

    </div> <!-- site -->

    <div class="push"></div>

    </div>

    <div id="footer">
      <div class="site">
        <div class="info">
          <div class="logo">
            <a href="http://github.com/">
              <img src="/images/modules/header/logo_white.png" alt="GitHub" />
            </a>
          </div>
          <div class="more">
            <div class="links">
              <a href="http://github.com/blog"><strong>Blog</strong></a> |
              <a href="http://support.github.com">Support</a> |
              <a href="http://github.com/contact">Contact</a> |
              <a href="http://github.com/site/privacy">Privacy</a> |
              <a href="http://github.com/site/terms">Terms of Service</a>
            </div>
            <div class="company">
              &copy;
              2011
              GitHub Inc.
              All rights reserved.
           </div>
          </div>
        </div>
        <div class="sponsor">
          <div>
            Powered by the <a href="http://www.rackspace.com ">Dedicated
            Servers</a> and<br/> <a href="http://www.rackspacecloud.com">Cloud
            Computing</a> of Rackspace Hosting<span>&reg;</span>
          </div>
          <a href="http://www.rackspace.com">
            <img alt="Dedicated Server" src="https://assets1.github.com/images/modules/footer/rackspace_logo.png?8ba4a5b555baa7617baab8277634c5c7550a44d7" />
          </a>
        </div>
      </div>
    </div>

    <script>window._auth_token = "23060acd732834e63a83b26f1bc91219bc4d8d15"</script>
  </body>
</html>
